USE test
GO

CREATE TABLE dbo.Blog(id INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
	title VARCHAR(200) NOT NULL,
	body VARCHAR(4000) NOT NULL,
	authoruid INT NOT NULL,
	documentType TINYINT NOT NULL,
	pubDate DATETIME NOT NULL,
	editDate DATETIME NOT NULL);
GO



ALTER TABLE dbo.Blog ADD CONSTRAINT FK_Blog_authoruid FOREIGN KEY(authoruid) REFERENCES dbo.[User](Id)

CREATE INDEX IX_Blog_pubDate ON dbo.Blog(pubDate)
GO